using System;
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Ccr.Core;
using Microsoft.Dss.Core.Attributes;
using Microsoft.Dss.ServiceModel.Dssp;
using Microsoft.Dss.ServiceModel.DsspServiceBase;
using W3C.Soap;
using submgr = Microsoft.Dss.Services.SubscriptionManager;

namespace BRS.AMEE.FeasibilityStudy {
    [Contract(Contract.Identifier)]
    [DisplayName("DummyService")]
    [Description("DummyService service (no description provided)")]
    class DummyService : DsspServiceBase {
        /// <summary>
        /// Service state
        /// </summary>
        [ServiceState]
        DummyServiceState _state = new DummyServiceState();

        /// <summary>
        /// Main service port
        /// </summary>
        [ServicePort("/DummyService", AllowMultipleInstances = true)]
        DummyServiceOperations _mainPort = new DummyServiceOperations();

        [SubscriptionManagerPartner]
        submgr.SubscriptionManagerPort _submgrPort = new submgr.SubscriptionManagerPort();

        /// <summary>
        /// Service constructor
        /// </summary>
        public DummyService(DsspServiceCreationPort creationPort)
            : base(creationPort) {
        }

        /// <summary>
        /// Service start
        /// </summary>
        protected override void Start() {

            // 
            // Add service specific initialization here
            // 

            base.Start();
        }

        /// <summary>
        /// Handles Subscribe messages
        /// </summary>
        /// <param name="subscribe">the subscribe request</param>
        [ServiceHandler]
        public void SubscribeHandler(Subscribe subscribe) {
            SubscribeHelper(_submgrPort, subscribe.Body, subscribe.ResponsePort);
        }
    }
}


